<template>
	<el-dialog title="发邮件" :visible.sync="visible" append-to-body width="992px">
		<el-form ref="form" size="medium" :model="formData" label-width="90px" style="width: 100%">
			<el-form-item label="接收人" prop="recevieUser">
				<el-input v-model="formData.recevieUser" style="width: 100%"></el-input>
			</el-form-item>
			<el-form-item label="主题" prop="subject">
				<el-input v-model="formData.subject" style="width: 100%"></el-input>
			</el-form-item>
			<el-form-item label="内容">
				<el-input type="textarea" v-model="formData.content" style="width: 100%"></el-input>
			</el-form-item>
		</el-form>
		<template slot="footer">
			<el-button size="medium" @click="visible = false">取消</el-button>
			<el-button size="medium" type="primary" @click="handleSubmitForm">确定</el-button>
		</template>
	</el-dialog>
</template>

<script>
import { addedMailMessage } from '@/api/business/tbMailMessage';
export default {
	props: {
		value: { type: Boolean, default: false }
	},
	data() {
		return {
			loading: false,
			visible: this.value,
			formData: {}
		};
	},
	watch: {
		value(flag) {
			this.visible = flag;
		},
		visible(flag) {
			this.$emit('input', flag);
		}
	},
	methods: {
		async handleSubmitForm() {
			let params = { ...this.formData };
			let result = await addedMailMessage(params).then((res) => res.data);
		}
	}
};
</script>

<style lang="scss" scoped></style>
